#ifndef DATABASE_MANAGER_H
#define DATABASE_MANAGER_H

#include <QtCore/QHash>
#include "dbmanager/sql_query.h"

namespace dbmanager {

class DatabaseManagerPrivate;

class DBMANAGER_EXPORT DatabaseManager : public QObject {
  Q_OBJECT
public:

  DatabaseManager(const QString &db_host,
                  quint16 db_port,
                  const QString &db_name,
                  const QString &db_user,
                  const QString &db_pass,
                  int num_connect_db,
                  const QString &name_prefix);

  ~DatabaseManager();

  int execSuccess() const;

  QHash<int, int> execFault() const;

  QString getDbHost() const;

  quint16 getDbPort() const;

  QString getDbName() const;

  QString getDbUser() const;

  QString getDbPass() const;

  int getNumConnectDb() const;

  QString getNamePrefix() const;

public slots:

  void execute(SqlQuery *query);

private:

  friend class DatabaseManagerPrivate;

  DatabaseManagerPrivate *p;
};

} // dbmanager

#endif // DATABASE_MANAGER_H
